Brownian first exit from and sojourn over one sided moving boundary and application