code cleanup
added anchor layout support