Adjusments to simplify the code