Simplify code, removed unwanted ones