wrapper for constructing, removing and handling with semaphores