drastic code simplification done