Code simplification and bugfix