Feature code cleanup

Small fixes and code beatifications